/* 全局样式 */
:root {
  --primary-color: #1a2a6c; /* 更新主色调为深蓝色 */
  --primary-light: #40a9ff; /* 新增浅蓝色 */
  --primary-dark: #096dd9; /* 新增深蓝色 */
  --success-color: #52c41a;
  --warning-color: #faad14;
  --error-color: #f5222d;
  --text-color: #333;
  --border-color: #f0f0f0;
  --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.09);
  --sidebar-width: 280px;
  --header-height: 64px;
  --border-radius: 8px;
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: #f5f5f5;
  color: var(--text-color);
}

.app-layout {
  display: grid;
  grid-template-areas:
    "header header"
    "sidebar main";
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr); /* 使主内容区域可扩展 */
  grid-template-rows: var(--header-height) 1fr;
  height: 100vh;
}

/* 页头样式 */
.app-header {
  grid-area: header;
  background: #f8fafc; /* 浅色背景 */
  color: white;
  padding: 24px 20px; /* 增加内边距 */
  display: flex;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 10;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.logo {
  font-size: 1.5rem;
  font-weight: 600;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: #1890ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* 侧边栏样式 */
.sidebar {
  grid-area: sidebar;
  background: white;
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  padding: 16px 12px; /* 减小内边距 */
  transition: var(--transition);
  position: fixed;
  width: var(--sidebar-width);
  height: calc(100vh - var(--header-height));
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-search {
  margin-bottom: 24px;
}

.search-box {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-color);
  padding: 10px 14px; /* 增加内边距 */
  border-radius: 6px; /* 更圆润的边角 */
  background-color: #f8f9fa; /* 浅灰色背景 */
  transition: all 0.3s;
}

.search-box:hover {
  background-color: #fff;
  box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2); /* 悬停效果 */
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
}

.menu-section {
  margin-bottom: 12px;
}

/* 侧边栏菜单项 */
.menu-item {
  display: flex;
  align-items: center;
  padding: 10px 12px; /* 减小内边距 */
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s;
  margin-bottom: 6px;
}

.menu-item:hover {
  background-color: #e6f7ff; /* 浅蓝色悬停效果 */
}

.menu-item.level-1 {
  font-size: 16px; /* 稍大字体 */
  font-weight: 600;
  color: var(--primary-color); /* 使用主色 */
}

.menu-item.level-2 {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s;
  margin-bottom: 8px;
  background-color: #f8fafc;
}

.menu-item.level-2:hover {
  background-color: #e6f7ff;
}

.menu-item .menu-text {
  flex: 1;
}



.arrow {
  margin-right: 8px;
  width: 16px;
  display: inline-block;
}

.er-list {
  padding-left: 20px;
  margin-top: 4px;
}

.er-item {
  display: flex;
  align-items: center;
  padding: 4px 0;
  font-size: 13px;
}

.er-icon {
  margin-right: 8px;
}

/* 主内容区域 */
.main-content {
  grid-area: main;
  padding: 24px 32px; /* 增加水平内边距 */
  overflow-y: auto;
  background-color: #f9fafb;
  margin-left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
  height: calc(100vh - var(--header-height));
}

/* 卡片样式 */
.card {
  background: #fff;
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
  padding: 20px;
  margin-bottom: 32px; /* 增加间距 */
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border-top: 3px solid var(--primary-color); /* 顶部边框使用主色 */
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

.card-title {
  font-size: 18px; /* 稍大字体 */
  font-weight: 600; /* 加粗 */
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--primary-color); /* 使用主色 */
}

/* 统计卡片布局 */
.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); /* 增加最小宽度 */
  gap: 20px; /* 增加间距 */
}

.stat-item {
  background: white;
  border-radius: var(--border-radius);
  padding: 20px;
  text-align: center;
  box-shadow: var(--card-shadow);
  transition: var(--transition);
  border-left: 4px solid var(--primary-color); /* 左侧边框使用主色 */
}

.stat-label {
  font-size: 14px;
  color: #666;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 24px;
  font-weight: 600;
}

.running {
  color: var(--primary-color);
}

.stat-progress {
  display: flex;
  justify-content: center;
}

/* 表格美化 */
.task-table {
  overflow-x: auto;
}

.task-table table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 100%; /* 使用全宽 */
}

.task-table th {
  background-color: #f0f7ff; /* 浅蓝色背景 */
  color: var(--primary-color); /* 使用主色 */
  font-weight: 600;
  padding: 14px 18px; /* 增加内边距 */
  text-align: left;
  position: sticky;
  top: 0;
}

.task-table td {
  padding: 12px 18px; /* 增加内边距 */
  border-bottom: 1px solid var(--border-color);
}

.task-table tr:hover td {
  background-color: #f7fbff;
}

.status-badge {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
}

.status-badge.completed {
  background-color: rgba(82, 196, 26, 0.1);
  color: var(--success-color);
}

.status-badge.running {
  background-color: rgba(24, 144, 255, 0.1);
  color: var(--primary-color);
}

.status-badge.failed {
  background-color: rgba(245, 34, 45, 0.1);
  color: var(--error-color);
}

.status-badge.pending {
  background-color: rgba(250, 173, 20, 0.1);
  color: var(--warning-color);
}

.actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-group {
  display: flex;
  gap: 4px;
}

/* 按钮美化 */
.btn-primary {
  background: #1890ff;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  color: white;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(24, 144, 255, 0.3);
}

.btn-primary:hover {
  background: #40a9ff;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(24, 144, 255, 0.4);
}

.btn-outline {
  background: transparent;
  border: 1px solid #d9d9d9;
  padding: 9px 20px;
  border-radius: 6px;
  color: #666;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-outline:hover {
  border-color: #1890ff;
  color: #1890ff;
  background: rgba(24, 144, 255, 0.05);
}

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: #666;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transition: all 0.3s;
}

.btn-icon:hover {
  background-color: #e6f7ff; /* 浅蓝色悬停效果 */
  color: var(--primary-color); /* 使用主色 */
}

/* 模态框美化 */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  background-color: #f0f7ff; /* 浅蓝色背景 */
}

/* 模态框美化 */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85); /* 更深的遮罩 */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000; /* 确保高于所有内容 */
  backdrop-filter: blur(3px); /* 背景模糊效果 */
}

.modal-content {
  background: white;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
  width: 520px;
  max-width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: modalAppear 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 2px solid #1890ff;
  z-index: 10001;
  transform: translateZ(0); /* 强制硬件加速 */
}

@keyframes modalAppear {
  0% {
    transform: translateY(30px) scale(0.95);
    opacity: 0;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* 增强关闭按钮 */
.close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  cursor: pointer;
  color: #999;
  transition: all 0.3s;
  padding: 5px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10002;
}

.close-btn:hover {
  background-color: #f5f5f5;
  color: #ff4d4f;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.upload-options {
  border: 2px dashed #d9d9d9;
  border-radius: 8px;
  padding: 30px 20px;
  text-align: center;
  margin-top: 15px;
  transition: all 0.3s;
  background-color: #fafafa;
  position: relative;
  overflow: hidden;
}

.upload-options:hover {
  border-color: #1890ff;
  background-color: #e6f7ff;
  box-shadow: 0 0 15px rgba(24, 144, 255, 0.2);
}

.upload-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}

.upload-btn input {
  display: none;
}

.upload-hint {
  color: #999;
  font-size: 14px;
  margin-top: 8px;
}

.or-divider {
  margin: 16px 0;
  position: relative;
  text-align: center;
}

.or-divider:before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: #eee;
  z-index: 1;
}

.or-divider span {
  position: relative;
  background: white;
  padding: 0 12px;
  z-index: 2;
  color: #999;
}

.direct-input {
  display: flex;
  gap: 8px;
}

.table-name-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
}

.er-preview {
  margin-top: 25px;
  border-top: 1px solid #eee;
  padding-top: 20px;
  position: relative;
}

.er-preview h4 {
  margin-bottom: 15px;
  font-size: 16px;
  color: #333;
  font-weight: 600;
}

.preview-content {
  background: #f8f8f8;
  padding: 15px;
  border-radius: 6px;
  max-height: 250px;
  overflow: auto;
  font-family: 'Courier New', monospace;
  white-space: pre-wrap;
  border: 1px solid #e8e8e8;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
  font-size: 13px;
  line-height: 1.5;
}

/* 图表类型选择器 */
.chart-type-selector {
  display: flex;
  gap: 8px;
}

.type-btn {
  padding: 4px 12px;
  border: 1px solid #d9d9d9;
  background: white;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.type-btn.active {
  background: #e6f7ff;
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.menu-item .status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
}

.menu-item .status-indicator.online {
  background-color: var(--primary-color); /* 使用主色 */
}

.menu-item .status-indicator.offline {
  background-color: var(--error-color);
}

.menu-item .status-indicator.warning {
  background-color: var(--warning-color);
}

.menu-item .ds-details {
  font-size: 11px;
  color: #888;
  margin-left: 8px;
}

/* 菜单项操作按钮组 */
.menu-actions {
  margin-left: auto;
  display: flex;
  gap: 4px;
  visibility: hidden;
}

.menu-item:hover .menu-actions {
  visibility: visible;
}

/* 新增数据源按钮底部样式 */
.add-datasource-btn {
  position: sticky;
  bottom: 0;
  background: white;
  padding: 16px;
  border-top: 1px solid var(--border-color);
  z-index: 10;
}

/* 表单样式 */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: #333;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  font-size: 14px;
  transition: all 0.3s;
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
  outline: none;
}

.form-row {
  display: flex;
  gap: 12px;
}

.custom-select {
  position: relative;
}

.custom-select select {
  appearance: none;
  background-color: white;
  padding: 10px 14px;
  width: 100%;
}

.select-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: #999;
}

@keyframes slideIn {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* 移除任务探查摘要的悬浮效果 */
.task-summary:hover {
  transform: none;
  box-shadow: var(--card-shadow);
}

/* 移除数据库任务分布图表的悬浮效果 */
.distribution-chart:hover {
  transform: none;
  box-shadow: var(--card-shadow);
}

/* 移除统计项的悬浮效果 */
.stat-item:hover {
  box-shadow: none; /*box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);*/
}

/* 加载状态样式 */
.loading-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text-color);
  font-size: 16px;
}

/* 空状态样式 */
.empty-state {
  text-align: center;
  padding: 40px;
  color: #999;
}

/* 禁用状态按钮 */
.btn-primary:disabled {
  background-color: #ccc;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* 任务详情模态框 */
.task-details-modal {
  width: 90%;
  max-width: 1000px;
  max-height: 90vh;
}

.task-details-modal .modal-body {
  padding: 20px;
}

.task-info-section {
  background-color: #f8f9fa;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.info-item {
  padding: 8px;
  background: white;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* 标签页 */
.details-tabs {
  margin-top: 20px;
}

.details-tabs .ant-tabs-tab {
  padding: 12px 16px !important;
}

/* 摘要统计 */
.summary-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

.stat-item {
  background: white;
  border-radius: 8px;
  padding: 15px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.09);
  border-left: 4px solid var(--primary-color);
}

.stat-label {
  font-size: 14px;
  color: #666;
  margin-bottom: 5px;
}

.stat-value {
  font-size: 24px;
  font-weight: 600;
}

.stat-value.error {
  color: var(--error-color);
}

/* 表格卡片 */
.tables-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.table-card {
  background: white;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.09);
  transition: transform 0.3s ease;
}

.table-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.table-header {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.table-stats {
  margin-left: auto;
  display: flex;
  gap: 10px;
  font-size: 14px;
  color: #666;
}

.data-quality {
  margin-top: 15px;
}

.data-quality h4 {
  margin-bottom: 10px;
  color: var(--primary-color);
}

.issue-type {
  margin-bottom: 10px;
  padding: 10px;
  background: #f9f9f9;
  border-radius: 4px;
}

.issue-type ul {
  padding-left: 20px;
  margin-top: 5px;
}

/* 关系表格 */
.relationships-table {
  overflow-x: auto;
  margin-top: 15px;
}

.relationships-table table {
  width: 100%;
  border-collapse: collapse;
}

.relationships-table th, 
.relationships-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.relationships-table th {
  background-color: #f0f7ff;
  color: var(--primary-color);
  font-weight: 600;
}

.relationships-table tr:hover td {
  background-color: #f7fbff;
}

/* 业务规则 */
.rules-list {
  margin-top: 15px;
}

.rule-item {
  background: white;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.09);
}

.rule-header {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.rule-description {
  color: #666;
  margin-bottom: 10px;
}

.violation-count {
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 12px;
  margin-left: 10px;
}

.violation-count.error {
  background-color: rgba(245, 34, 45, 0.1);
  color: var(--error-color);
}

.violation-count.success {
  background-color: rgba(82, 196, 26, 0.1);
  color: var(--success-color);
}

.rule-samples {
  margin-top: 10px;
  padding: 10px;
  background: #f9f9f9;
  border-radius: 4px;
  font-size: 13px;
}

.rule-samples pre {
  overflow: auto;
  max-height: 200px;
  padding: 10px;
  background: #f5f5f5;
  border-radius: 4px;
  margin-top: 8px;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #999;
  font-size: 14px;
}

/* ER关系图容器 */
.er-diagram-wrapper {
  position: relative;
  height: 600px;
  width: 100%;
  margin-top: 15px;
  border-radius: 8px;
  overflow: hidden;
  background-color: #fafafa;
  box-shadow: 0 2px 8px rgba(0,0,0,0.09);
}

.er-diagram-toolbar {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  display: flex;
  gap: 8px;
}

.toolbar-btn {
  background: white;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.3s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.toolbar-btn:hover {
  background: #f0f7ff;
  border-color: #1890ff;
  color: #1890ff;
}

/* 节点样式增强 */
.custom-node-rect {
  fill: white;
  stroke: #d9d9d9;
  stroke-width: 1;
  rx: 8;
  ry: 8;
}

.custom-node-header {
  fill: #f0f7ff;
  stroke: #1890ff;
  stroke-width: 1.5;
  rx: 8;
  ry: 8;
}

.custom-node-text {
  font-size: 14px;
  text-anchor: middle;
  fill: #1890ff;
  font-weight: bold;
}

.custom-node-column {
  font-size: 11px;
  fill: #333;
}

/* 连接线样式增强 */
.link-path {
  stroke: #a0a0a0;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
}

.link-path:hover {
  stroke: #ff9e00;
  stroke-width: 3;
}

.link-label-bg {
  fill: rgba(255, 255, 255, 0.85);
  stroke: #d9d9d9;
  stroke-width: 0.5;
  rx: 3;
  ry: 3;
}

.link-label-text {
  font-size: 12px;
  fill: #666;
  text-anchor: middle;
  pointer-events: none;
}

/* 加载状态 */
.er-diagram-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #999;
}

/* 添加以下样式 */

/* 任务详情模态框 */
.task-details-modal {
  width: 90%;
  max-width: 1000px;
  max-height: 90vh;
}

.task-details-modal .modal-body {
  padding: 20px;
}

/* 任务信息部分 */
.task-info-section {
  background-color: #f8f9fa;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.info-item {
  padding: 8px;
  background: white;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* 摘要统计 */
.summary-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

.stat-item {
  background: white;
  border-radius: 8px;
  padding: 15px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.09);
  border-left: 4px solid var(--primary-color);
}

.stat-label {
  font-size: 14px;
  color: #666;
  margin-bottom: 5px;
}

.stat-value {
  font-size: 24px;
  font-weight: 600;
}

.stat-value.error {
  color: var(--error-color);
}

/* 表格卡片 */
.tables-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.table-card {
  background: white;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.09);
  transition: transform 0.3s ease;
}

.table-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.table-header {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.table-stats {
  margin-left: auto;
  display: flex;
  gap: 10px;
  font-size: 14px;
  color: #666;
}

.table-columns {
  margin-top: 15px;
}

.table-columns h4 {
  margin-bottom: 10px;
  color: var(--primary-color);
}

.columns-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.column-item {
  background: #f9f9f9;
  padding: 10px;
  border-radius: 4px;
  font-size: 13px;
}

.column-name {
  font-weight: 500;
  margin-bottom: 4px;
}

.column-type {
  color: #666;
  font-size: 12px;
  margin-bottom: 4px;
}

.column-stats .badge {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 3px;
  margin-right: 4px;
}

.column-stats .primary {
  background-color: rgba(82, 196, 26, 0.1);
  color: var(--success-color);
}

.column-stats .foreign {
  background-color: rgba(24, 144, 255, 0.1);
  color: var(--primary-color);
}

/* 关系表格 */
.relationships-table {
  overflow-x: auto;
  margin-top: 15px;
}

.relationships-table table {
  width: 100%;
  border-collapse: collapse;
}

.relationships-table th, 
.relationships-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.relationships-table th {
  background-color: #f0f7ff;
  color: var(--primary-color);
  font-weight: 600;
}

.relationships-table tr:hover td {
  background-color: #f7fbff;
}

/* 业务规则 */
.rules-list {
  margin-top: 15px;
}

.rule-item {
  background: white;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.09);
}

.rule-header {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.rule-description {
  color: #666;
  margin-bottom: 10px;
}

.violation-count {
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 12px;
  margin-left: 10px;
}

.violation-count.error {
  background-color: rgba(245, 34, 45, 0.1);
  color: var(--error-color);
}

.violation-count.success {
  background-color: rgba(82, 196, 26, 0.1);
  color: var(--success-color);
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #999;
  font-size: 14px;
}

/* ER关系图容器 */
.er-diagram-wrapper {
  position: relative;
  height: 600px;
  width: 100%;
  margin-top: 15px;
  border-radius: 8px;
  overflow: hidden;
  background-color: #fafafa;
  box-shadow: 0 2px 8px rgba(0,0,0,0.09);
}

.er-diagram-toolbar {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  display: flex;
  gap: 8px;
}

.toolbar-btn {
  background: white;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.3s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.toolbar-btn:hover {
  background: #f0f7ff;
  border-color: #1890ff;
  color: #1890ff;
}

/* 加载状态 */
.er-diagram-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #999;
}

.er-diagram-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 500px;
  border: 1px dashed #d9d9d9;
  border-radius: 8px;
  background-color: #fafafa;
}

.empty-message {
  padding: 20px;
  text-align: center;
  color: #999;
  font-size: 16px;
}

/* 表详情视图 */
.table-details-view {
  padding: 20px;
}

.table-details-view .table-header {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
}

.table-details-view .table-header h2 {
  margin: 0;
  font-size: 22px;
  color: var(--primary-color);
}

.back-btn {
  background: #f0f7ff;
  border: 1px solid #d9e8ff;
  color: var(--primary-color);
  padding: 8px 15px;
  border-radius: 6px;
  cursor: pointer;
  margin-right: 15px;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.3s;
}

.back-btn:hover {
  background: #e6f7ff;
  border-color: var(--primary-color);
}

.metadata-section {
  background: #f9fafb;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
}

.metadata-section h3 {
  color: var(--primary-color);
  margin-top: 0;
  margin-bottom: 15px;
}

.metadata-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 15px;
}

.metadata-item {
  background: white;
  border-radius: 6px;
  padding: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.meta-label {
  display: block;
  font-weight: 500;
  color: #666;
  margin-bottom: 5px;
  font-size: 14px;
}

.meta-value {
  font-size: 16px;
  font-weight: 500;
}

.columns-section {
  margin-bottom: 20px;
}

.columns-section h3 {
  color: var(--primary-color);
  margin-top: 0;
  margin-bottom: 15px;
}

.columns-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 15px;
}

.column-card {
  background: white;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.column-name {
  font-weight: 600;
  font-size: 16px;
}

.column-flags {
  display: flex;
  gap: 8px;
}

.flag {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 4px;
}

.flag.primary {
  background: rgba(82, 196, 26, 0.1);
  color: var(--success-color);
}

.flag.foreign {
  background: rgba(24, 144, 255, 0.1);
  color: var(--primary-color);
}

.column-stats {
  font-size: 14px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.stat-label {
  color: #666;
}

.stat-value {
  font-weight: 500;
}

.analysis-section {
  background: #f9fafb;
  border-radius: 8px;
  padding: 15px;
}

.analysis-title {
  color: var(--primary-color);
  margin-top: 0;
  margin-bottom: 12px;
}

.analysis-content {
  background: white;
  border-radius: 6px;
  padding: 15px;
  max-height: 300px;
  overflow-y: auto;
}

.analysis-item {
  display: flex;
  margin-bottom: 10px;
}

.analysis-key {
  font-weight: 500;
  min-width: 180px;
  color: #666;
}

.analysis-value {
  flex: 1;
  word-break: break-word;
}

.no-analysis {
  text-align: center;
  padding: 20px;
  color: #999;
}

/* 表卡片中的分析摘要 */
.table-analysis {
  margin-top: 15px;
}

.analysis-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.analysis-item {
  background: #f0f7ff;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 13px;
}

/* 安全容器样式 */
.safe-er-diagram-container {
  position: relative;
  width: 100%;
  height: 600px;
  overflow: hidden;
  isolation: isolate; /* 防止外部样式影响 */
}

/* 错误边界样式 */
.error-boundary {
  padding: 20px;
  background: #fff2f0;
  border: 1px solid #ffccc7;
  border-radius: 4px;
  text-align: center;
}

.error-boundary h3 {
  color: #cf1322;
}

.error-boundary button {
  margin-top: 15px;
  padding: 8px 15px;
  background: #fff;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s;
}

.error-boundary button:hover {
  border-color: #1890ff;
  color: #1890ff;
}

/* ====== 数据质量样式 ====== */
.data-quality-section {
  background-color: #fff2f0;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
  border: 1px solid #ffccc7;
}

.data-quality-section h3 {
  color: #cf1322;
  font-weight: 600;
  margin-bottom: 15px;
}

.issue-type {
  margin-bottom: 15px;
  padding: 10px;
  background: #fff;
  border-radius: 4px;
  border-left: 3px solid #ff4d4f;
}

.issue-type h4 {
  color: #cf1322;
  margin-bottom: 8px;
  font-weight: 500;
}

.issue-type ul {
  padding-left: 20px;
  margin-top: 5px;
}

.issue-type li {
  margin-bottom: 5px;
  color: #595959;
}

.no-quality {
  text-align: center;
  padding: 20px;
  color: #8c8c8c;
  font-style: italic;
}

/* ====== 质量评分卡片 ====== */
.quality-summary {
  display: flex;
  background: #f6ffed;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
  border: 1px solid #b7eb8f;
}

.quality-score {
  flex: 1;
  text-align: center;
  padding: 10px;
}

.score-value {
  font-size: 28px;
  font-weight: 700;
  color: #52c41a;
  margin-bottom: 10px;
}

.score-label {
  font-size: 14px;
  color: #666;
}

.quality-stats {
  flex: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stat-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  margin-bottom: 8px;
  border-radius: 4px;
  font-size: 14px;
}

.stat-item.error {
  background: #fff1f0;
  color: #cf1322;
}

.stat-item.success {
  background: #f6ffed;
  color: #52c41a;
}

.stat-item span {
  margin-left: 8px;
}

/* ====== 分析项增强样式 ====== */
.analysis-item {
  display: flex;
  margin-bottom: 10px;
  padding: 8px;
  background: #f8f9fa;
  border-radius: 4px;
}

.analysis-key {
  font-weight: 500;
  min-width: 180px;
  color: #595959;
}

.analysis-value {
  flex: 1;
  word-break: break-word;
  font-family: monospace;
}

/* ====== 表卡片质量指示器 ====== */
.table-card .quality-summary {
  margin-top: 15px;
  padding: 8px;
  background: #f0f7ff;
}

.table-card .quality-label {
  text-align: center;
  font-size: 12px;
  color: #1890ff;
  margin-top: 5px;
}

/* ====== 关系表格优化 ====== */
.relationships-table table th, 
.relationships-table table td {
  padding: 10px 12px;
}

.relationships-table tr:hover td {
  background-color: #f7fbff;
}

/* ====== 表卡片优化 ====== */
.table-card .table-stats span {
  margin-right: 12px;
}

.table-card .quality-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
}

.quality-indicator.good {
  background-color: #52c41a;
}

.quality-indicator.warning {
  background-color: #faad14;
}

.quality-indicator.error {
  background-color: #f5222d;
}